﻿<%@ Page Language="C#" MasterPageFile="~/CmsMaster.Master" AutoEventWireup="true" CodeBehind="ListTimesheet.aspx.cs" Inherits="ContractManagementSystem.Presentation.TimesheetManagement.ListTimesheet" Title="Timesheet Manager >>> List Timesheet" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <link href="../../Styles/ClientStyle.css" rel="stylesheet" type="text/css" />

    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/JsLibrary.js"> </script>    
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/jquery.js"> </script>
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/menu.js"> </script>
    
    <link href="../../JavaScript/validationEngine/css/jquery-ui-1.8.21.custom.css" rel="stylesheet"
          type="text/css" />
    <script src="../../JavaScript/validationEngine/js/jquery-ui-1.8.21.custom.min.js"
            type="text/javascript"> </script>
        
    <script type="text/javascript">
        $.datepicker.formatDate("MM/dd/yyyy");
        $(document).ready(function() {
        	$(".inp-datetime").datepicker();
        });
    </script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <div class="CPF">
        <div class="CPFSearch">
<%-- 
            <div id="CPFalertMessage" class="CPFerror">
                <asp:Label runat="server" ID="labelResultMessage" CssClass="CPFResultMessage" Visible="false"></asp:Label>
            </div> --%>
    
            <div class="clear"></div>
            <div class="CPFrow">
                <div class="CPFcols">
                    <label>Contract</label>
                </div>
        
                <div class="CPFcols">
                    <asp:DropDownList runat="server" ID="dropContract" Height="20px" Width="150px"/>
                </div>
         
                <div class="CPFcols">
                    <label>From Date</label>
                </div>   
        
                <div class="CPFcols">
                    <asp:TextBox runat="server" ID="textFromDate" CssClass="inp-datetime" 
                                 Height="16px" Width="100px"></asp:TextBox>
                </div> 
         
                <div class="CPFcols">
                    <label>Sort By</label>
                </div>
        
                <div class="CPFcols">
                    <asp:DropDownList runat="server" ID="dropSort" Height="20px" Width="100px">
                        <asp:ListItem></asp:ListItem>
                        <asp:ListItem>Date</asp:ListItem>
                        <asp:ListItem>Contract</asp:ListItem>
                        <asp:ListItem>Status</asp:ListItem>
                    </asp:DropDownList>
                </div>    
           
            </div>
   
            <div class="CPFrow">
                <div class="CPFcols"><label >Status</label></div>
        
                <div class="CPFcols">
                    <asp:DropDownList runat="server" ID="dropStatus" Height="20px" Width="150px">
                        <asp:ListItem></asp:ListItem>
                        <asp:ListItem>Rejected</asp:ListItem>
                        <asp:ListItem>Approved</asp:ListItem>
                        <asp:ListItem>Pending</asp:ListItem>
                    </asp:DropDownList>
                </div>
        
                <div class="CPFcols">
                    <label >To Date</label>
                </div>
        
                <div class="CPFcols">
                    <asp:TextBox runat="server" ID="textToDate" CssClass="inp-datetime" 
                                 Height="16px" Width="100px"></asp:TextBox>
                </div>
        
                <div class="CPFcols">
                    <label style="color: #A3A300;font-weight: bold;">mm/dd/yyyy</label>     
                </div>
        
                <div class="CPFcols">
                    <asp:Button runat="server" ID="Button2" Text="Search" CssClass="CPFButton1" OnClick="ButtonSearchClick"/>        
                </div>
            </div>
    
        </div>


        <div class="CPFGrid ">
            
            <asp:ListView runat="server" ID="listTimesheet"
                          onitemcommand="ListTimesheetItemCommand" 
                          onitemdeleting="ListTimesheetItemDeleting" >
                <LayoutTemplate>
                   <table class="repeaterTable"> 
                        <tr class="tableHeader">
                            
                            <td>Contract Number</td>
                            <td>OnDate</td>
                            <td>Time</td>
                            <td>Description</td>
                            <td>Status</td>
                            <td>Contractor</td>
                            <td>Option</td>
                        </tr>
                        <tr id="itemPlaceholder" runat="server"></tr>
                    </table> 
                    
                    <table class="CPFrepeaterTable" >
                        <tr class="CPFtableHeader">
                            <td class="CPFPage">
                                <asp:DataPager runat="server" ID="ItemDataPager"  PagedControlID="listTimesheet"  PageSize="10" >
                                    <Fields>
                                        <asp:NextPreviousPagerField  ShowFirstPageButton="true" ShowNextPageButton="false" ShowPreviousPageButton="false" ButtonCssClass="CPFNumPage" />
                                        <asp:NumericPagerField ButtonCount="5" NumericButtonCssClass="CPFNumPage" CurrentPageLabelCssClass="CPFCurrentNumPage"/>
                                        <asp:NextPreviousPagerField  ShowLastPageButton="true" ShowNextPageButton="true" ShowPreviousPageButton="false" ButtonCssClass="CPFNumPage"/>
                                    </Fields>                    
                                </asp:DataPager>                
                            </td>
                         </tr>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr class="CPFTr">


                        <td class="CPFtd">
                            <asp:Label runat="server" ID="labelContractNumber" Width="100"  Height="20"><%#Eval("ContractNumber")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label runat="server" ID="lable2" Width="70"  Height="20"><%#DateTime.Parse(Eval("OnDate").ToString()).ToString("MM/dd/yyyy")%></asp:Label>
                        </td>
                        <td class="CPFtdtime" style="text-align: center;">
                            <asp:Label runat="server" ID="Label3" Width="20" Height="20"><%#Eval("Time")%></asp:Label>
                        </td>
                        <td class="CPFtd cpfdescript">
                            <asp:Label runat="server" ID="Label5" Width="130"  Height="20"><%#Eval("Description")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label runat="server" ID="Label4" Width="20" Height="20"><%#Eval("Status")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label runat="server" ID="Label2" Width="150" Height="20"><%#Eval("Contractor")%></asp:Label>
                        </td>
                        <td class="CPFtd">                            
                            <asp:LinkButton  runat="server" OnClientClick='javascript:return confirm("Are you sure you want to delete?")' CommandName="Delete" CommandArgument='<%#Eval("TimesheetDetailId")%>'>
                                <asp:Image runat="server" CssClass="CPFdelete" ImageUrl="../../Images/CPFdelete.png"></asp:Image>
                            </asp:LinkButton>
                        
                            <a href="UpdateTimesheet.aspx?id=<%#Eval("TimesheetDetailId")%>">
                                <asp:Image  runat="server" CssClass="CPFdelete" ImageUrl="../../Images/CPFedit.png"></asp:Image>
                            </a>                    
                        </td>
                    </tr>    
                </ItemTemplate>
                
                <EmptyDataTemplate>
                    <table class="repeaterTable"> 
                        <tr class="tableHeader">
                            
                            <td>Contract Number</td>
                            <td>OnDate</td>
                            <td>Time</td>
                            <td>Description</td>
                            <td>Status</td>
                            <td>Contractor</td>
                            <td>Option</td>
                        </tr>
                        
                        <tr>
                            <td colspan="7" class="CPFNotData">
                                <label style="color: #FF0000; font-size: 18px;">Sorry ! no data found</label>
                            </td>                            
                        </tr> 
                        
                    </table> 

                </EmptyDataTemplate>
            </asp:ListView>  
                     
        </div>      

    </div>
</asp:Content>